/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package textfilewriter.entity.fact;

import java.text.SimpleDateFormat;
import java.util.Date;
import textfilewriter.entity.dimension.Customer;

/**
 *
 * @author GiangLT
 */
public class VasUsagePattern {

    private Date startDate;
    private Date endDate;
    private String product;
    private Customer customer;
    private double revenue;
    private int numOfServiceUsages;
    private int numOfCustomer;
    private double vasArpu;

    public VasUsagePattern() {
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public int getNumOfCustomer() {
        return numOfCustomer;
    }

    public void setNumOfCustomer(int numOfCustomer) {
        this.numOfCustomer = numOfCustomer;
    }

    public int getNumOfServiceUsages() {
        return numOfServiceUsages;
    }

    public void setNumOfServiceUsages(int numOfServiceUsages) {
        this.numOfServiceUsages = numOfServiceUsages;
    }

    public String getProduct() {
        return product;
    }

    public void setProduct(String product) {
        this.product = product;
    }

    public double getRevenue() {
        return revenue;
    }

    public void setRevenue(double revenue) {
        this.revenue = revenue;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public double getVasArpu() {
        return vasArpu;
    }

    public void setVasArpu(double vasArpu) {
        this.vasArpu = vasArpu;
    }
    
    @Override
    public String toString() {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        StringBuilder sb = new StringBuilder();
        sb.append(dateFormat.format(startDate));
        sb.append("|");
        sb.append(dateFormat.format(endDate));
        sb.append("|");
        sb.append(customer.getCustFirstName());
        sb.append(" ");
        sb.append(customer.getCustLastName());
        sb.append("|");
        sb.append(customer.getCustStreetAddress());
        sb.append("|");
        sb.append(customer.getCustCity());
        sb.append("|");
        sb.append(product);
        sb.append("|");
        sb.append(revenue);
        sb.append("|");

        return sb.toString();
    }

    public String getHeader() {
        return "Start date|End date|Customer name|Customer Address|City|Product|Revenue";
    }
}
